import request from '@/utils/request'

// 查询充电宝列表
export function listTreasure(query) {
  return request({
    url: '/system/treasure/list',
    method: 'get',
    params: query
  })
}

// 查询充电宝详细
export function getTreasure(treasureId) {
  return request({
    url: '/system/treasure/' + treasureId,
    method: 'get'
  })
}

// 新增充电宝
export function addTreasure(data) {
  return request({
    url: '/system/treasure',
    method: 'post',
    data: data
  })
}

// 修改充电宝
export function updateTreasure(data) {
  return request({
    url: '/system/treasure',
    method: 'put',
    data: data
  })
}

// 删除充电宝
export function delTreasure(treasureId) {
  return request({
    url: '/system/treasure/' + treasureId,
    method: 'delete'
  })
}
